authentication-services-colmena
How to Get a New Token
1. Authorize the Application to Act on Behalf of a Colmena User
Using the Client ID from the connected app job-connected-apps-auth-token-{env}
, authorization must be requested to allow the application to act as a user.
Values
| --------- | --------------------------------- |
| Host: | anypoint.mulesoft.com |
| URL: | /accounts/api/v2/oauth2/authorize |
Input Paramenters:
Query Parameters | Value | Descripcion |
---|---|---|
client_id | client_id de connectedapp: job-connected-apps-auth-token-{env} | |
scope | offline_access%20full | scopes para solicitar token y refresh token |
response_type | code | tipo de respuesta esperado |
redirect_uri | https://google.com | url de redireccion al recibir respuesta |
nonce | 123456 | valor default |
Example Request
anypoint.mulesoft.com/accounts/api/v2/oauth2/authorize?client_id=asd5f4aa5sd4fa6s5&scope=offline_access%20full&response_type=code&redirect_uri=[https://google.com&nonce=123456](https://google.com&nonce=123456)
2. Request a Token
Input Parameters
Request:
POST /accounts/api/v2/oauth2/token HTTP/1.1
Host: anypoint.mulesoft.com
Content-Type: application/json
{
"client_id": "",
"redirect_uri": "https://example.com",
"client_secret": "",
"grant_type": "authorization_code",
"code": ""
}
Parameter | Value | Description |
---|---|---|
client_id | client_id from connected app: job-connected-apps-auth-token-{env} | Unique ID of the connected app |
redirect_uri | https://google.com | URL to redirect upon receiving the response. |
client_secret | client_secret from connected app: job-connected-apps-auth-token-{env} | Secret key of the connected app |
grant_type | authorization_code | Default value |
code | Code obtained from the previous step |
Output parameters
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token": "",
"refresh_token": "",
"expires_in": "",
"token_type": "bearer"
}
3. Use Refresh Token
In Runtime Manager under authentication-services-colmena > properties
, update the following values:
Parameter | Description |
---|---|
token.client_id | client_id from connected app: job-connected-apps-auth-token-{env} |
secure::token.client_secret | client_secret from connected app: job-connected-apps-auth-token-{env} |
secure::token.refresh_token | Refresh token obtained in the previous step |